<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	template="template.xhtml">

  <ui:define name="content">
      <f:metadata>
          <f:viewParam name="vehicleId" value="#{editVehicle.vehicleId}" />
          <f:event type="preRenderView" listener="#{editVehicle.onLoad}" />
      </f:metadata>
		<h:messages />
		<h:form>
			<h:panelGrid columns="2">
				<h:outputLabel for="title" value="Reg. No:" />
				<h:outputText value="#{editVehicle.vehicle.vehCharRegno}"></h:outputText>
				
				<h:outputLabel for="make" value="Make:" />
				<h:inputText id="make" value="#{editVehicle.vehicle.vehCharMake}"></h:inputText>
					
					
				<h:outputLabel for="model" value="Model::" />
				<h:inputText id="model" value="#{editVehicle.vehicle.vehCharModel}"></h:inputText>
				
				<h:outputLabel for="Insurance:" value="Insurance::" />
				<h:inputText id="Insurance" value="#{editVehicle.vehicle.vehCharInsurance}"></h:inputText>
				
				<h:outputLabel for="Insurance Expiry Date" value="Insurance Expiry Date:" />
				<p:calendar id="insuranceExpiryDate" value="#{editVehicle.vehicle.vehDateInsurexpiry}" required="true"
					showOn="button" pattern="EEE, dd MMM, yyyy" showButtonPanel="true" navigator="true" requiredMessage="Vehicle insurance Exp Date is mandatory"  />
				
			</h:panelGrid>
			
			<h:commandButton value="Update" action="#{editVehicle.update}"></h:commandButton>
			<h:commandButton value="Delete" action="#{editVehicle.remove}" onclick="return confirm('You sure brotha?');"></h:commandButton>
		</h:form>
  </ui:define>
  
</ui:composition>
